
<div class="well row-fluid">
    <div class="input-prepend span4">
        <span class="add-on">全名</span>
        <?php
        echo CHtml::activeTextField($model, $categoryNameField, array('placeholder' => 'category Name' . '...', 'required' => true, 'class' => 'span9'));
        ?>
    </div>
    <div class="input-prepend span4">
        <span class="add-on">别名</span>
        <?php
        echo CHtml::activeTextField($model, $categoryAliasField, array('placeholder' => 'category alias' . '...', 'required' => true, 'class' => 'span9'));
        ?>
    </div>
    <div class="input-append span2">
        <?php
        echo $control->getAjaxLink(array('name' => '添加分类', 'id' => 'addCategory'), array(
            'ownerClass' => $ownerClass,
            'ownerType' => $ownerType,
            'ownerId' => $ownerId,
            'htmlOptions' => array('class' => 'btn span12'),
            'categoryId' => 0
        ));
        ?>
    </div>
</div>
<?php if (count($categoryView) > 0) { ?>
    <div style="min-height: 100px">
        <table class="table table-hover">
            <colgroup>
                <col class="span1">
                <col class="span3">
                <col class="span3">
                <col class="span3">
            </colgroup>
            <thead>
                <tr>
                    <th></th>
                    <th><?php echo '分类全名'; ?></th>
                    <th><?php echo '分类别名'; ?></th>
                    <th><?php echo '操作'; ?></th>
                </tr>
            </thead>
            <tbody>
                <?php
                foreach ($categoryView as $id => $list) {
                    $categoryName = '';
                    $categoryAlias = '';
                    $categoryIdItem = $list->getItem('categoryId');
                    if ($categoryIdItem instanceof BTreeItem) {
                        $categoryId = $categoryIdItem->getValue();
                        $category = new BACategory($categoryId);
                        $categoryName = $category->getCategoryFullName();
                        $categoryAlias = $category->getValue();
                    }
                    if ($categoryName != '') {
                        ?>
                        <tr><td><input type="checkbox"></td>
                            <td> <?php
                                echo $categoryName;
                                ?> </td>
                            <td>
                                <?php
                                echo $categoryAlias;
                                ?>
                            </td>
                            <td>
                                <?php
                                echo $control->getAjaxLink(array(
                                    'name' => '删除',
                                    'id' => 'deleteCategory'), array(
                                    'ownerClass' => $ownerClass,
                                    'ownerType' => $ownerType,
                                    'ownerId' => $ownerId,
                                    'htmlOptions' => array('class' => ''),
                                    'categoryId' => $id
                                ));
                                ?>
                            </td>
                        </tr>   
                        <?php
                    }
                }
                ?>
            </tbody>
        </table>
    </div>
<?php } ?>



